#include "comm/my_hooks.h"
#include "comm/my_log.h"

void my_handler_1(void *data)
{
    MY_LOG_DEBUG("handler_1: %d", (int)(intptr_t)data);
}

void my_handler_2(void *data)
{
    MY_LOG_DEBUG("handler_2: %d", (int)(intptr_t)data);
}

void my_handler_3(void *data)
{
    MY_LOG_DEBUG("handler_3: %d", (int)(intptr_t)data);
}

void my_test()
{
    my_hook_chain_register(global_hook_chain, my_handler_1);
    my_hook_chain_register(global_hook_chain, my_handler_2);
    my_hook_chain_register(global_hook_chain, my_handler_3);

    my_hook_chain_exec(global_hook_chain, (void *)123);
}

int main()
{
    my_hooks_init();

    my_test();

    my_cleanup_list_exec(&g_cleanup_list);

    my_mem_assert_leak();

    MY_LOG_DEBUG("test pass");
    return 0;
}